package com.poi.action;

import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.StrutsStatics;

import javax.servlet.http.HttpServletRequest;

public class savexcel {
	

	public void saveExcelData(String entityName) {
		HttpServletRequest request=(HttpServletRequest)ActionContext.getContext().get(StrutsStatics.HTTP_REQUEST);

		System.out.println("saveExcelData"+entityName);
		parseExcelUtil peu = new  parseExcelUtil();
		
		String upsql = importexcel.uploadsql;
       System.out.println("upsql==="+upsql);
		System.out.println(peu.getListDatas());
		
		if(upsql.equals("DominantZooplankton")){
			System.out.println("=====");
			DomiantZooplanktonDao dao = new DomiantZooplanktonDao();
			dao.saveUser();
		}
		if(upsql.equals("DominantPhytoplankton")){
			System.out.println("=====");
			DominantPhytoplanktonDao dao = new DominantPhytoplanktonDao();
			dao.saveUser();
		}
		if(upsql.equals("DominantBenthos")){
			System.out.println("=====");
			DominantBenthosDao dao = new DominantBenthosDao();
			dao.saveUser();
		}
	
		if(upsql.equals("Sediment")){
			System.out.println("=====");
			SedimentDao dao = new SedimentDao();
			dao.saveUser();
		}
		
		if(upsql.equals("Fishes")){
			System.out.println("=====");
			FishesDao dao = new FishesDao();
			dao.saveUser();
		}
		if(upsql.equals("FishEggs")){
			System.out.println("=====");
			FishEggsDao dao = new FishEggsDao();
			dao.saveUser();
		}
		
	if(upsql.equals("CatchTools")){ 
		System.out.println("=====");
		CatchToolsDao dao = new CatchToolsDao();
		dao.saveUser();
	}
	

	
	}	
	
	
}
